<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="com.domain.ZhongLei,java.util.ArrayList,com.domain.*"%>

<%
YongHu yonghu=(YongHu)session.getAttribute("yonghu");

ArrayList<ShangPin> dingdanxiangqing=(ArrayList<ShangPin>)session.getAttribute("dingdanxiangqing");
ShangPin shangpin;	

if(yonghu==null)
{
	request.getRequestDispatcher("yonghudenglu.jsp").forward(request, response);
}
if(dingdanxiangqing==null)
{
	request.getRequestDispatcher("Gerenzhongxin").forward(request, response);
}
%>

<html>
	<head>
		<style>A{text-decoration: NONE} </style>
		<title>订单详情</title>
	</head>
	<body >
	<table width="100%" >
		<tr>
			<td align="left"><a href="shangchengshouye.jsp">商城首页</a></td>
			<td align="right">
				<a href="Gerenzhongxin"><%=yonghu.getYonghuming()%></a>&nbsp;
				<a href="Tuichu">退出</a>
			</td>
		</tr>
	</table>

	<br><br>

	<table align="center" width="100%" bgcolor="#d0eed8" >	
		<colgroup width="20%" span="5">
		<tr>
			<th>图片</th>
			<th>名字</th>
			<th>价格</th>
			<th>数量</th>
			<th>金额</th>
		</tr>
	</table>
	<br>
<%
		for(int i=dingdanxiangqing.size()-1;i>=0;i--)
		{
			shangpin=dingdanxiangqing.get(i);
			if(shangpin.getTupian().size()==0)
			{
%>
				<table align="center" width="100%" bgcolor="#d0eed8" cellspacing="10">	
					<colgroup width="20%" span="5">
					<tr align="center">
						<td>商品已下架</td>
						<td><%=shangpin.getMingzi() %></td>
						<td><%=shangpin.getJiage() %></td>
						<td><%=shangpin.getShuliang() %></td>
						<td><%=shangpin.getJiage()*shangpin.getShuliang() %></td>
					</tr>
				</table>	
				<br>	
<%					
			}
			else
			{
%>
				<table align="center" width="100%" bgcolor="#d0eed8" cellspacing="10">	
					<colgroup width="20%" span="5">
					<tr align="center">
						<td><a href="Shangpinxiangqing?shangpinbianhao=<%=shangpin.getBianhao()%>"><img src="./images/<%=shangpin.getTupian().get(0) %>.jpg" width="100%"></a></td>
						<td><a href="Shangpinxiangqing?shangpinbianhao=<%=shangpin.getBianhao()%>"><%=shangpin.getMingzi() %></a></td>						
						<td><%=shangpin.getJiage() %></td>
						<td><%=shangpin.getShuliang() %></td>
						<td><%=shangpin.getJiage()*shangpin.getShuliang() %></td>						
					</tr>
				</table>	
				<br>
<%					
			}			
		}
%>						
<br>	
  </body>
</html>
